﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using TLL.Finance.Currencys;

namespace TLL.Finance.BankSys
{
    public class BankInvoice
    {
        private string cardNumber = string.Empty;
        private DateTime trandate = DateTime.MinValue;
        private double amount = 0;
        private double rest = 0;
        private bool inCard = true;
        private string detail = string.Empty;
        private CurrencyType currencytype = default(CurrencyType);

        public string CardNumber { get { return this.cardNumber; } }
        public DateTime TranDate { get { return this.trandate; } }
        public double Amount { get { return this.amount; } }
        public bool InCard { get { return this.inCard; } }
        public string FormatAmount
        {
            get
            {
                switch (currencytype)
                {
                    case Currencys.CurrencyType.USD: return this.inCard ? "+" + this.amount.ToString("0,000.0") + " USD" : "- " + this.amount.ToString("0,000.0") + " USD";
                    case Currencys.CurrencyType.RUB: return this.inCard ? "+" + this.amount.ToString("0,000.0") + " RUB" : "- " + this.amount.ToString("0,000.0") + " RUB";
                    case Currencys.CurrencyType.UAH: return this.inCard ? "+" + this.amount.ToString("0,000.0") + " UAH" : "- " + this.amount.ToString("0,000.0") + " UAH";
                }
                return string.Empty;
                //return this.inCard ? "+" + this.amount.ToString() : "-" + this.amount.ToString();
            }
        }
        public double Rest { get { return this.rest; } }
        public string Detail { get { return this.detail; } }
        public CurrencyType CurrencyType { get { return this.currencytype; } }
        public BankInvoice(string cardNumber, DateTime trandate, double amount, double rest, string detail, bool inCard, CurrencyType currencytype)
        {
            this.cardNumber = cardNumber;
            this.trandate = trandate;
            this.amount = amount;
            this.rest = rest;
            this.detail = detail;
            this.inCard = inCard;
            this.currencytype = currencytype;
        }
    }
}
